/*
 * @Author: xuxu12138 1718324422@qq.com
 * @Date: 2024-01-18 09:13:14
 * @LastEditors: xuxu12138 1718324422@qq.com
 * @LastEditTime: 2024-01-27 08:16:55
 * @FilePath: /things-admin/src/base/api/moments.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { request } from '@/base/Request';
import { Moments, Moments1, Moments2} from '@/base/model/Moments'
import qs from 'qs'

// 查询
export const momentAll = (params: {
    pageSize: Number,
    pageIndex: Number,
    nickname: String,
    createBegin: String,
    approvalStatus: Number,
    createEnd:String
}) => request.get(Moments, `/api/moments?pageIndex=${params.pageIndex}&pageSize=${params.pageSize}&nickname=${params.nickname}&createBegin=${params.createBegin}&approvalStatus=${params.approvalStatus}&createEnd=${params.createEnd}`)

export const editData = (id:number) => request.get(Moments1, `/api/moments/${id}`)

// 编辑
export const monentPut = (params:any) => request.put(Moments, '/api/moments', qs.stringify(params) )

// 查询帖评论 /api/comments/findByMomentId
export const findByMomentId = (params:{
    pageSize: Number,
    pageIndex: Number,
    momentId:Number,
    createBegin: String,
    createEnd:String,
    deleted:Number,
    nickname:String,
    type:Number
}) => request.get(Moments, `/api/comments/findAllByMomentId?pageSize=${params.pageSize}&pageIndex=${params.pageIndex}&momentId=${params.momentId}&nickname=${params.nickname}&createBegin=${params.createBegin}&createEnd=${params.createEnd}&deleted=${params.deleted}&type=${params.type}`)


// 查询帖子评论 /api/comments/findById/{id}
export const edidfindById = (id:number) => request.get(Moments2, `/api/comments/findById/${id}`)

// 修改评论 /api/comments
export const editcomments = (params:any) => request.put(Moments, '/api/comments', qs.stringify(params) )

// 删除评论 
export const deletecomments = (id:Number) => request.delete(`/api/moments/deleted/${id}`)


export const deletecomments1 = (id:Number) => request.delete(`/api/comments/deleted/${id}`)

